package com.sugar.follow.up.module.business.dal.mysql.publicityeducation;

import java.util.*;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.dal.dataobject.publicityeducation.PublicityEducationDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.follow.up.module.business.controller.admin.publicityeducation.vo.*;

/**
 * 宣教 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface PublicityEducationMapper extends BaseMapperX<PublicityEducationDO> {

    default PageResult<PublicityEducationDO> selectPage(PublicityEducationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PublicityEducationDO>()
                .eqIfPresent(PublicityEducationDO::getTitle, reqVO.getTitle())
                .eqIfPresent(PublicityEducationDO::getClsId, reqVO.getClsId())
                .likeIfPresent(PublicityEducationDO::getAuthorName, reqVO.getAuthorName())
                .betweenIfPresent(PublicityEducationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PublicityEducationDO::getId));
    }

}